home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_18_1987_Transactor_Publishing.d64 / copy-all64 glink (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  5KB  |  137 lines

  1. 1 rem save"0:copyall 64 glink",8
  2. 2 rem ** jim butterfield's c64 copy-all
  3. 3 rem ** modified for use with the glink ieee-488 interface
  4. 4 rem ** richard evers 07-06-1987
  5. 5 :
  6. 6 rem ** allows concurrent copying of data
  7. 7 rem ** serial to ieee-488, ieee-488 to serial
  8. 8 rem ** serial to serial or ieee-488 to ieee-488
  9. 9 rem ** via transactor's glink ieee-488 interface
  10. 10 :
  11. 11 rem ** transactor publishing inc.
  12. 12 rem ** 85 west wilmot st., #10
  13. 13 rem ** richmond hill,ontario, canada
  14. 14 rem ** l4b-1k7 (416) 764-5273
  15. 15 :
  16. 16 print "[147]  disk copy-all      jim butterfield"
  17. 17 print "** glink ieee-488 interface version **"
  18. 18 print " copies between serial and ieee drives"
  19. 19 a$="!jim butterfield!": a$=a$+a$+a$: a$=a$+a$+a$+a$+a$
  20. 20 p$=""
  21. 21 dim l2(232),l1%(232),n$(232),t%(232),t$(4)
  22. 22 data xxx,seq,prg,usr,rel
  23. 23 for j=0 to 4: read t$(j): nextj
  24. 24 :
  25. 25 rem when size=3956 then code begins at 6005
  26. 26 z1=6027: rem entry point #1
  27. 27 z2=z1+3: rem entry point #2
  28. 28 z3=z2+3: rem entry point #3
  29. 29 z4=z3+3: rem entry point #4
  30. 30 init=z4+3: rem move rom to ram, etc.
  31. 31 swap=init+3: rem swap rom to ram or vice-versa
  32. 32 fr=251: tu=252: tp=253: rem from, to and temp storage of drive type
  33. 33 :
  34. 34 input"from unit  8[157][157][157]";f
  35. 35 gosub123: rem get drvnum
  36. 36 f$=d$
  37. 37 input "1) serial or 2) ieee  2[157][157][157]";tf
  38. 38 if tf<1 or tf>2 then 37
  39. 39 :
  40. 40 input"to unit  8[157][157][157]";t
  41. 41 gosub123: rem get drvnum
  42. 42 t$=d$
  43. 43 input "1) serial or 2) ieee  1[157][157][157]";tt
  44. 44 if tt<1 or tt>2 then 43
  45. 45 :
  46. 46 if f=t and f$=t$ and tt=tf then run
  47. 47 :
  48. 48 poke fr,tf-1: poke tu,tt-1: rem drive type source and destination
  49. 49 sys(init): rem move rom to ram, etc.
  50. 50 xx=fr: gosub 136: n=0: close1: close15: open 15,f,15: print#15,"i"+f$
  51. 51 gosub127: if e then stop: goto 50
  52. 52 z=90: print: input"pattern  *[157][157][157]";p$
  53. 53 p$="xxx"+left$(p$+"[160][160][160][160][160][160][160][160][160][160][160][160][160][160][160]",16)
  54. 54 print "hold down 'y' or 'n' key to select"
  55. 55 print "programs to be copied..."
  56. 56 open 1,f,3,"$"+f$: rem ok
  57. 57 gosub127: if e then stop: goto50
  58. 58 sys(z1)
  59. 59 r=255: goto 61
  60. 60 sys(z2)
  61. 61 for j=16to2step-1: if asc(mid$(a$,j+3))=160 then nextj
  62. 62 n$=mid$(a$,4,j)
  63. 63 t9=asc(a$)-128: if t9<1 or t9>4 goto75
  64. 64 l1%=asc(mid$(a$,22))
  65. 65 l2=asc(mid$(a$,29))+asc(mid$(a$,30))*256
  66. 66 print right$("   "+mid$(str$(l2),2),4)" :"mid$(a$,4,16)" "t$(t9)"      "
  67. 67 p=peek(203) and r
  68. 68 get z$: if z$="" and p<064 goto73
  69. 69 if z$="y" or z$="n" then z=asc(z$): r=255: goto73
  70. 70 if z$=chr$(13) then r=0: goto73
  71. 71 goto68
  72. 72 :
  73. 73 if z<80 then print "[145]                     [145]": goto75
  74. 74 n=n+1: l2(n)=l2: n$(n)=n$: t%(n)=t9: l1%(n)=l1%
  75. 75 if st=0 and n<232 goto60
  76. 76 xx=fr: gosub 136: close1: close15: print " * * * * *                  "
  77. 77 if n=0 then print "* no programs *": goto 120
  78. 78 for j=1 to n
  79. 79 l2=l2(j): t%=t%(j): if l>l2 goto100
  80. 80 if q=0 goto84
  81. 81 print "*** output disk full"
  82. 82 input"do you have a new one";z$
  83. 83 if asc(z$)<>89 then 122
  84. 84 close15: xx=tu: gosub 136: rem swap to destination
  85. 85 open 15,t,15: input"want to new the output disk  n[157][157][157]";z$
  86. 86 if asc(z$)<>89 goto92
  87. 87 :
  88. 88 input"disk name,id";x$,y$
  89. 89 print#15,"n"+t$+":"+x$+","+y$
  90. 90 gosub127: if e then stop: goto84
  91. 91 :
  92. 92 print#15,"i"+t$: open 1,t,0,"$"+t$+": !#$%&"
  93. 93 gosub127: if e then stop: goto84
  94. 94 gosub131: gosub131: q=q+1
  95. 95 get#1,x$: if x$<>"" goto95
  96. 96 gosub131
  97. 97 l=x+y*256: print "(";l;"blocks free )"
  98. 98 xx=tu: gosub 136: close1: close15: goto79
  99. 99 :
  100. 100 xx=fr: gosub 136: open 14,f,15: rem source cmd channel
  101. 101 xx=tu: gosub 136: open 15,t,15: rem dest cmd channel
  102. 102 print left$(n$(j)+"                    ",21);
  103. 103 xx=fr: gosub 136: open 3,f,3,f$+":"+n$(j)+","+t$(t%)
  104. 104 input#14,e,e$,e1,e2: gosub128: if e then print "** ";e$;e: goto117
  105. 105 :
  106. 106 xx=tu: gosub 136: rem destination
  107. 107 if t%=4 then open 4,t,4,t$+":"+n$(j)+",l,"+chr$(l1%(j)): goto111
  108. 108 :
  109. 109 open 4,t,4,t$+":"+n$(j)+","+t$(t%)+",w"
  110. 110 :
  111. 111 l=l-l2: gosub127: if e then print "*** ";e$;e: goto117
  112. 112 if t%=4 then sys(z4): goto114: rem relative copy
  113. 113 sys(z3)
  114. 114 xx=tu: gosub 136: rem set destination again
  115. 115 n$(j)="": gosub127: if e then print "**** ";e$;e: goto117
  116. 116 print "[145]"
  117. 117 xx=fr: gosub 136: close3: close14: rem source
  118. 118 xx=tu: gosub 136: close4: close15: rem destination
  119. 119 nextj
  120. 120 x=fre(0): input"another input disk ready";z$
  121. 121 if asc(z$)=89 goto50
  122. 122 poke 1,55: end
  123. 123 input"drive  0[157][157][157]";d
  124. 124 if d*d<>d goto123
  125. 125 d$=chr$(d+48): return
  126. 126 :
  127. 127 input#15,e,e$,e1,e2
  128. 128 if e=0 then e=(st and 191): e$="*st*"
  129. 129 return
  130. 130 :
  131. 131 get#1,x$,x$,x$
  132. 132 x=asc(x$+chr$(0))
  133. 133 get#1,x$: y=asc(x$+chr$(0))
  134. 134 return
  135. 135 :
  136. 136 poke tp,peek(xx): sys(swap): return: rem flip to source/destination drive
  137.